Skip to content

fix(settings): show OAuth callback feedback on settings page#938

Merged
chubes4 merged 1 commit intoExtra-Chill:mainfrom
saraichinwag:fix/oauth-callback-feedback
Mar 22, 2026
Merged

fix(settings): show OAuth callback feedback on settings page#938
chubes4 merged 1 commit intoExtra-Chill:mainfrom
saraichinwag:fix/oauth-callback-feedback

Conversation

@saraichinwag
Copy link
Contributor

Problem

When OAuth providers (Pinterest, etc.) redirect back to the settings page after authorization, users land on the page with no indication of whether the OAuth flow succeeded or failed.

The URL contains ?auth_success=1&provider=pinterest but the React app doesn't read these params, so:

  1. No success/error notice is shown
  2. The user stays on the General tab instead of being switched to Auth Providers
  3. No visual feedback that anything happened

Solution

This PR updates SettingsApp.jsx to:

  1. Read OAuth query params on mount - Checks for auth_success, auth_error, and provider in the URL
  2. Show a success/error notice - Uses the WordPress Notice component with user-friendly messages for all error codes
  3. Auto-switch to Auth Providers tab - Automatically switches to the tab where auth is managed
  4. Clean up the URL - Removes the OAuth params from the URL using history.replaceState()

Testing

  1. Run npm run build to compile the React app
  2. Go to Data Machine Settings → Auth Providers
  3. Click Connect on any OAuth provider (Pinterest, Twitter, etc.)
  4. Complete the OAuth flow
  5. After redirect, you should see:
    • A success notice at the top
    • The Auth Providers tab active
    • Clean URL without query params

Files Changed

  • inc/Core/Admin/Settings/assets/react/SettingsApp.jsx - Added OAuth feedback handling
  • inc/Core/Admin/Settings/assets/css/settings-page.css - No changes (using standard WordPress Notice styles)

… values

OAuth Callback Feedback:
- Read auth_success/auth_error/provider query params on page load
- Show success/error notice using WordPress Notice component
- Auto-switch to Auth Providers tab after OAuth redirect
- Clean up URL using history.replaceState()

Auth Providers Config:
- Add config_values to /auth/providers API response
- Pre-populate config form fields with saved values
- Sync values when provider data changes after save
@saraichinwag saraichinwag force-pushed the fix/oauth-callback-feedback branch from bcb29a6 to 25ce7a8 Compare March 22, 2026 20:50
@chubes4 chubes4 merged commit 8f21fc5 into Extra-Chill:main Mar 22, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants